<%-- 
    Document   : addVehicle
    Created on : May 13, 2009, 12:26:03 AM
    Author     : Viet Bui
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<c:set var="title" value="Add Vehicle" scope="page"/>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${title}</title>
    </head>
    <body>
        <h1>${title}</h1>
        <f:view>
            <!-- Show error messages -->
            <h:form id="frmNotification">
                <h:inputHidden id="hdnGeneralVehicleErrorNotification" ></h:inputHidden>
                <h:message showSummary="true" showDetail="true" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="hdnGeneralVehicleErrorNotification"/>
            </h:form>

            <h:form id="vehicle">
                <table>
                    <tr>
                        <td class="label">Name: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleJSFManagedBean.vehicle.name}" required="true" id="name"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="name"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Description: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleJSFManagedBean.vehicle.description}" required="true" id="description"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="description"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Make and model: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleJSFManagedBean.vehicle.makeAndModel}" required="true" id="makeAndModel"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="makeAndModel"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Colour: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleJSFManagedBean.vehicle.colour}" required="true" id="colour"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="colour"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Year: </td>
                        <td class="required">*</td>
                        <td><h:inputText value="#{VehicleJSFManagedBean.vehicle.year}" required="true" id="year"/></td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="year"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Vehicle type: </td
                        <td class="required">*</td>
                        <td>
                            <h:selectOneMenu value="#{VehicleJSFManagedBean.vehicle.vehicleType.id}" required="true" id="vehicleTypeId">
                                <f:selectItems value="#{VehicleJSFManagedBean.vehicleTypes}" />
                            </h:selectOneMenu>
                        </td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="vehicleTypeId"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="label">Vehicle licence type: </td>
                        <td class="required">*</td>
                        <td>
                            <h:selectOneMenu value="#{VehicleJSFManagedBean.vehicle.vehicleLicenceType.id}" required="true" id="vehicleLicenceTypeId">
                                <f:selectItems value="#{VehicleJSFManagedBean.vehicleLicenceTypes}" />
                            </h:selectOneMenu>
                        </td>
                        <td>
                            <h:message showSummary="true" showDetail="false" style="color: red; font-family: 'New Century Schoolbook', serif; font-style: oblique" for="vehicleLicenceTypeId"/>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                        <td><h:commandButton id="submit" value="Submit" action="#{VehicleJSFManagedBean.addVehicle}"/></td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
            </h:form>
        </f:view>
    </body>
</html>